import request from '@/utils/request'

// 获取菜单tree
export function getMenuTree(data) {
  return request({
    url: '/api/admin/getMenuTree',
    method: 'get',
    params: data
  })
}

// 获取菜单elementui-tree
export function getMenuElementUiTree(data) {
  return request({
    url: '/api/admin/getMenuElementUiTree',
    method: 'get',
    params: data
  })
}

// 修改菜单
export function updateMenu(data) {
  return request({
    url: '/api/admin/updateMenu',
    method: 'put',
    data: data
  })
}

// 增加菜单
export function addMenu(data) {
  return request({
    url: '/api/admin/addMenu',
    method: 'post',
    data: data
  })
}

// 删除菜单
export function deleteMenu(data) {
  return request({
    url: '/api/admin/deleteMenu/' + data,
    method: 'delete'
  })
}

// 获取菜单tree
export function getMenuTreeByRoleKey(data) {
  return request({
    url: '/api/admin/getMenuTreeByRoleKey',
    method: 'get',
    params: data
  })
}
